function result=read_data(map_name)

fileID=fopen(map_name);

f_magic = fread(fileID,1,'uint32');
if f_magic~=hex2dec('15432345')
%     printf("There must be something wrong! Check your data pls!");
    error("There must be something wrong! Check your data pls!");
end

Mx=fread(fileID,1,'int32');
My=fread(fileID,1,'int32');

M_map=fread(fileID,[Mx,My],'int8');
start_x=fread(fileID,1,'int32');
start_y=fread(fileID,1,'int32');
end_x=fread(fileID,1,'int32');
end_y=fread(fileID,1,'int32');
result={Mx,My,M_map,start_x,start_y,end_x,end_y};
end
